package com.seepln.modal;
/**
 * Created by
 *
 * @auth: liqy
 * on 2021/3/3 18:33.
 * desc:
 */

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 * @ClassName: Protocol
 * @Description: 协议元数据
 * @Author: liqy
 * @CreateDate: 2021/3/3 18:33
 * @UpdateUser: liqy
 * @UpdateDate: 2021/3/3  18:33
 * @UpdateRemark: update TODO
 * @Version: 1.0
 */
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DBProtocol {
    private String name;
    private String type;
    private String version;
    private String driver;
    private String url;
    private String user;
    private String pass;

    private Boolean autoCommit;
    private String connectionTestQuery;
    private Integer connectionTimeout;
    private Long IdleTimeout;
    private Boolean isolateInternalQueries;
    private Integer maximumPoolSize;
    private Long maxLifetime;
    private Integer minimumIdle;
    private String poolName;

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public Boolean getAutoCommit() {
        return autoCommit;
    }

    public void setAutoCommit(Boolean autoCommit) {
        this.autoCommit = autoCommit;
    }

    public String getConnectionTestQuery() {
        return connectionTestQuery;
    }

    public void setConnectionTestQuery(String connectionTestQuery) {
        this.connectionTestQuery = connectionTestQuery;
    }

    public Integer getConnectionTimeout() {
        return connectionTimeout;
    }

    public void setConnectionTimeout(Integer connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

    public Long getIdleTimeout() {
        return IdleTimeout;
    }

    public void setIdleTimeout(Long idleTimeout) {
        IdleTimeout = idleTimeout;
    }

    public Boolean getIsolateInternalQueries() {
        return isolateInternalQueries;
    }

    public void setIsolateInternalQueries(Boolean isolateInternalQueries) {
        this.isolateInternalQueries = isolateInternalQueries;
    }

    public Integer getMaximumPoolSize() {
        return maximumPoolSize;
    }

    public void setMaximumPoolSize(Integer maximumPoolSize) {
        this.maximumPoolSize = maximumPoolSize;
    }

    public Long getMaxLifetime() {
        return maxLifetime;
    }

    public void setMaxLifetime(Long maxLifetime) {
        this.maxLifetime = maxLifetime;
    }

    public Integer getMinimumIdle() {
        return minimumIdle;
    }

    public void setMinimumIdle(Integer minimumIdle) {
        this.minimumIdle = minimumIdle;
    }

    public String getPoolName() {
        return poolName;
    }

    public void setPoolName(String poolName) {
        this.poolName = poolName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DBProtocol that = (DBProtocol) o;
        return Objects.equals(name, that.name) &&
                Objects.equals(type, that.type) &&
                Objects.equals(version, that.version) &&
                Objects.equals(driver, that.driver) &&
                Objects.equals(url, that.url) &&
                Objects.equals(user, that.user) &&
                Objects.equals(pass, that.pass) &&
                Objects.equals(autoCommit, that.autoCommit) &&
                Objects.equals(connectionTestQuery, that.connectionTestQuery) &&
                Objects.equals(connectionTimeout, that.connectionTimeout) &&
                Objects.equals(IdleTimeout, that.IdleTimeout) &&
                Objects.equals(isolateInternalQueries, that.isolateInternalQueries) &&
                Objects.equals(maximumPoolSize, that.maximumPoolSize) &&
                Objects.equals(maxLifetime, that.maxLifetime) &&
                Objects.equals(minimumIdle, that.minimumIdle) &&
                Objects.equals(poolName, that.poolName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, type, version, driver, url, user, pass, autoCommit, connectionTestQuery, connectionTimeout, IdleTimeout, isolateInternalQueries, maximumPoolSize, maxLifetime, minimumIdle, poolName);
    }

    @Override
    public String toString() {
        return "DBProtocol{" +
                "name='" + name + '\'' +
                ", type='" + type + '\'' +
                ", version='" + version + '\'' +
                ", driver='" + driver + '\'' +
                ", url='" + url + '\'' +
                ", user='" + user + '\'' +
                ", pass='" + pass + '\'' +
                ", autoCommit=" + autoCommit +
                ", connectionTestQuery='" + connectionTestQuery + '\'' +
                ", connectionTimeout=" + connectionTimeout +
                ", IdleTimeout=" + IdleTimeout +
                ", isolateInternalQueries=" + isolateInternalQueries +
                ", maximumPoolSize=" + maximumPoolSize +
                ", maxLifetime=" + maxLifetime +
                ", minimumIdle=" + minimumIdle +
                ", poolName='" + poolName + '\'' +
                '}';
    }
}
